<template>
  <div>
    <search-control :searh-bar="searhBar" @search="search" />
    <el-card>
      <el-header style="font-size: 12px; padding:0" class="father">
        <div class="spanrecord" style="background-color: #fff9eb;color: #ffb200;border: 1px solid #ffb200; width: 200px;">
          <span slot="before">共166条记录</span>
        </div>
      </el-header>
      <el-table
        :data="list"
        stripe
        style="width: 70vw"
        :header-cell-style="{background:'#f9f6ee','text-align':'center'}"
        :cell-style="{'text-align':'center'}"
        border
      >
        <!-- <el-table-column
          type="index"
          label="序号"
        />
        <el-table-column
          prop="warehouseName"
          label="所属仓库"
        />
        <el-table-column
          prop="code"
          label="库区编号"
        />
        <el-table-column
          prop="name"
          label="库区名称"
        />
        <el-table-column
          prop="temperatureType"
          label="温度类型"
          :formatter="formatterTem"
        />
        <el-table-column
          prop="bearingType"
          label="承重类型"
          :formatter="formatterBer"
        />
        <el-table-column
          prop="useType"
          label="用途属性"
          :formatter="formatterUse"
        />
        <el-table-column
          prop="status"
          label="库区状态"
          :formatter="formatterSta"
        />
        <el-table-column
          prop="personName"
          label="负责人"
        />
        <el-table-column
          prop="phone"
          label="联系电话"
        />
        <el-table-column
          prop="includedNum"
          label="库位数量"
        />
        <el-table-column
          prop="updateTime"
          label="更新时间"
        />
        <el-table-column
          fixed="right"
          label="操作"
        /> -->
      </el-table>
      <!-- <el-row type="flex" justify="center" align="middle">
        <el-pagination
          :current-page="pageConfig.current"
          :page-sizes="[10, 20, 30, 40]"
          :page-size="pageConfig.size"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
        />
      </el-row> -->
    </el-card>
  </div>
</template>

<script>
import SearchControl from '@/components/SearchControl'

export default {
  name: 'YuanfengWarehouseStorageLoseProfit',
  components: { SearchControl },
  data() {
    return {
      searhBar: [
        { type: 'input', name: '损益单号', value: '' },
        { type: 'selete', name: '损益单状态', seleteType: 'loselist', value: '' },
        { type: 'input', name: '货主名称', value: '' },
        { type: 'input', name: '货品名称', value: '' }
      ],
      list: []
    }
  },
  methods: {
    // 改值
    changevalue(name, value) {
      const index = this.searhBar.findIndex(item => item.name === name)
      this.searhBar[index].value = value
    },
    // 重置
    resetvalue() {
      this.searhBar.forEach(item => {
        item.value = ''
      })
    },
    // 搜索 点击搜素按钮获取表单组件的值
    search() {
      console.log(36, this.searhBar)
    }
  },
  provide() {
    return {
      searhBar: this.searhBar,
      changevalue: this.changevalue,
      resetvalue: this.resetvalue
    }
  }
}

</script>

<style lang="scss" scoped>
.spanrecord{
  background-color: #fff9eb;
  color: #ffb200;
  border: 1px solid #ffb200;
  width: 200px;
}
</style>
